package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.domain.StrategyDetail;
import cn.wolfcode.trip.base.service.IStrategyDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 攻略文章资源控制器
 */
@RestController
@RequestMapping("strategyDetails")
public class StrategyDetailController {

    @Autowired
    private IStrategyDetailService detailService;
    /**
     * 根据攻略文章id查询文章对象
     * 1.资源 /strategyDetails/{id}
     * 2.请求方式 get
     * 3.请求参数 路径占位符
     * 4.返回结果 StrategyDetail
     */
    @GetMapping("{id}")
    public StrategyDetail getById(@PathVariable Long id){
        return detailService.getById(id);
    }

}
